package com.example.wechattakeaway.mapper;

import com.example.wechattakeaway.entity.OrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface OrderDetailMapper {

    /*
    新增一条订单详情
    @param OrderDetail
    @return null
     */
    Integer InsertOrderDetail(OrderDetail orderDetail);

    /*
    删除一条订单详情
    @param orderDetailId
    @return null
     */
    Integer DeleteOrderDetail(Integer orderDetailId);

    /*
    查询一个订单详情
    @param orderDetailId
    @return OrderDetail
     */
    OrderDetail SelectOrderDetailById(Integer orderDetailId);

    /*
    根据一个订单id查询所有订单详情
    @param orderId
    @return list
     */
    List<OrderDetail> SelectOrderDetailByOrder(Integer orderId);

}